package com.lzzy;

import chapter13.GeometricObject;

public class Ellipse extends GeometricObject {
    private double shortSemiAxis;
    private double longSemiAxis;

    public Ellipse(double shortSemiAxis,double longSemiAxis){
        this.shortSemiAxis=shortSemiAxis;
        this.longSemiAxis=longSemiAxis;
    }

    public double getArea(){
        return 3.14*shortSemiAxis*longSemiAxis;
    }

    public double getPerimeter(){
        return 2*3.14*longSemiAxis+4*(shortSemiAxis-longSemiAxis);
    }
}
